package de.jonasjelten.jcalc.math;

/**
 * Diese Klasse verwaltet die laufenden JMathExp-Threads
 * @author Jonas Jelten
 */
public class JThreadGroup extends ThreadGroup {
    public int runningThreads;
    public JVarTable cache, vars;
    public JInProgressTable calculating;
    
    public JThreadGroup(String name, JVarTable cache, JVarTable vars, JInProgressTable calculating) {
        super(name);
        this.cache = cache;
        this.vars = vars;
        this.calculating = calculating;
    }

    public int getActiveThreads() {
        return runningThreads;
    }

    public synchronized void addActive() {
        runningThreads++;
    }

    public synchronized void setInactive() {
        runningThreads--;
    }
}
